<?php
declare(strict_types=1);
namespace Service\Code;

class Normal
{
    /* 通用  */
    const FAIL              =   0;
    const SUC               =   200;

    /* 账户  */
    const ACCOUNT_UNLOGIN   =   1001;
    const ACCOUNT_FROZEN    =   1002;
    const TOKEN_ERROR       =   1003;
    const TOKEN_EXPIRED     =   1004;
    const ACCOUNT_UNKNOWN   =   1005;
    const CART_UNLOGIN      =   1006;//购物车未登录
    const ACCOUNT_UNIDENTIFY=   1007;//未实名认证
    const WEXIN_WEB_UNAUTH  =   1008;//微信公众号未授权
    const GUIDE_HAS_USED    =   1009;//用户已绑定导购员
    const GUIDE_NOT_EXITED  =   1010;//导购员不存在或者已禁用
    
    /* url */
    const URL_UNAUTH        =   3001;
    const URL_ERROR         =   3002;
    
    /* 参数  */
    const PARAM_SYS_ERROR   =   4001;
    const PARAM_BUS_ERROR   =   4002;
    const ADDRESS_ERROR     =   4003;
    const ADDRESS_AUTH      =   4004; //实名认证
    
    /* 支付 */
    const PAY_GATEWAY_EXCEPTION  = 5001;//支付通道异常
    const PAY_BUSINESS_EXCEPTION = 5001;//支付业务异常
    const PAY_BONDED_LIMIT       = 5002;//保税商品单笔订单不超过5000
    
    /* 拼团 */
    const ONLY_NO_PAY_USER  = 6001;//仅限未支付用户参与凑团
    
    /* 商品 */
    const OVER_BUY_LIMIT_BONDED  = 7001;//保税商品超过每月6件
    const OVER_BUY_LIMIT  = 7002;//商品超过限购
    
    const WS_START          = '1'; //进行中,
    const WS_END            = '2'; //已结束,
    const WS_ERROR          = '3'; //错误异常
    
    /**
     * 返回code
     * @param int $code
     * @param string $msg
     * @param array $data
     */
    public static function returnCode( $code = self::SUC , $msg = '',$data = [] ) {
        return [
            'code'  => $code,
            'msg'   => $msg,
            'data'  => $data,
        ];
    }

}